<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>Insert title here</title>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title></title>
    <!-- 最新 Bootstrap4 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.4.1/css/bootstrap.min.css">
    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="https://cdn.staticfile.org/jquery/3.4.1/jquery.min.js"></script>
    <!-- bootstrap.bundle.min.js 用于弹窗、提示、下拉菜单，包含了 popper.min.js -->
    <script src="https://cdn.staticfile.org/popper.js/1.16.0/umd/popper.min.js"></script>
    <!-- 最新的 Bootstrap4 核心 JavaScript 文件 -->
    <script src="https://cdn.staticfile.org/twitter-bootstrap/4.4.1/js/bootstrap.min.js"></script>
    <script th:src="@{/js/functions.js}"></script>
    <script type="text/javascript" th:inline="javascript">
        $(document).ready(
            function () {
                $('#loginFormModal').modal();
            }
        );
    </script>
</head>
<body>
<div class="modal fade" id="loginFormModal" role="dialog" aria-hidden="true" aria-labelledby="myModalLabel">
    <div class="modal-dialog">
        <div class="modal-content">
            <form class="form-signin" id="loginForm" th:method="post" th:action="@{/user/login}">
                <div class="modal-header">
                    <h5 class="modal-title" id="myModalLabel">用户登录</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">

                    <input type="text" id="username" name="username" class="form-control"
                           placeholder="用户名" required autofocus>

                    <input type="password" id="password" name="password" class="form-control"
                           placeholder="密码" required>
                    <div class="text-danger" th:text="${login!='yes'?login:''}"></div>
                </div>
                <div class="modal-footer">

                    <button class="btn btn-primary" type="submit" id="loginBtn">登录</button>
                    <button class="btn btn-secondary" type="button" data-dismiss="modal">关闭窗口</button>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
</html>